#include "StdAfx.h"
#include "Actior.h"


CActior::CActior(char* pPath)
{
	m_Id = 0;
	m_Position.left = 100;
	m_Position.top = 100;
	m_Position.right = 150;
	m_Position.bottom = 150;
	memcpy(&m_LastPos, &m_Position, sizeof(RECT));
	CLLPicture* picture = new CLLPicture(pPath, m_Position.left, m_Position.top, m_Position.right - m_Position.left, m_Position.bottom - m_Position.top);
	m_Body = picture;
}


CActior::~CActior(void)
{
}

void CActior::Update(HDC hdc)
{
	Draw(hdc);
}

void CActior::SetPoint(int nX, int nY)
{
	memcpy(&m_LastPos, &m_Position, sizeof(RECT));
	LLMOVERECT(nX, nY, m_Position);
	m_Body->SetSize(m_Position.right - m_Position.left, m_Position.bottom - m_Position.top);
	m_Body->SetPoint(nX, nY);
}

void CActior::GoBack2LastPos()
{
	SetPoint(m_LastPos.left, m_LastPos.top);
}

void CActior::Draw(HDC hdc)
{
	m_Body->SetSize(m_Position.right - m_Position.left, m_Position.bottom - m_Position.top);
	m_Body->SetPoint(m_Position.left, m_Position.top);
	m_Body->Draw(hdc);
}